
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, DateTime, Boolean, Text
from myScrapy.models.base_model import BaseModel
import datetime
import time

Base = declarative_base()


class DoubanCommentsModel(BaseModel, Base):
    __tablename__ = 'douban_comments'
    id = Column(Integer, primary_key=True)
    object_id = Column(Integer)
    comment = Column(Text)
    comment_id = Column(Integer)
    people_name = Column(String(255))
    people_url = Column(String(255))
    score = Column(Integer)
    comment_time = Column(DateTime)
    votes = Column(Integer)
    status = Column(Integer, default=1)
    created_at = Column(
        DateTime, default=datetime.datetime.fromtimestamp(time.time()))

    def __init__(self):
        super().__init__()
        pass
